package com.nanohadoop.yarn;

import java.io.Serializable;

/**
 * 表示分配给应用程序的资源容器
 */
public class Container implements Serializable {
    private static final long serialVersionUID = 1L;

    private String containerId;
    private String nodeId;
    private Resource resource;
    private String applicationId;

    public Container(String containerId, String nodeId, Resource resource, String applicationId) {
        this.containerId = containerId;
        this.nodeId = nodeId;
        this.resource = resource;
        this.applicationId = applicationId;
    }

    // Getters and Setters
    public String getContainerId() { return containerId; }
    public void setContainerId(String containerId) { this.containerId = containerId; }
    public String getNodeId() { return nodeId; }
    public void setNodeId(String nodeId) { this.nodeId = nodeId; }
    public Resource getResource() { return resource; }
    public void setResource(Resource resource) { this.resource = resource; }
    public String getApplicationId() { return applicationId; }
    public void setApplicationId(String applicationId) { this.applicationId = applicationId; }

    @Override
    public String toString() {
        return "Container{" +
                "containerId='" + containerId + '\'' +
                ", nodeId='" + nodeId + '\'' +
                ", resource=" + resource +
                ", applicationId='" + applicationId + '\'' +
                '}';
    }
}